package com.ecar.api.service.driver.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ecar.api.service.driver.IdeaService;
import com.ecar.api.support.util.UuidUtils;
import com.ecar.common.dto.DataBean;
import com.ecar.core.driver.dao.IdeaMapper;
import com.ecar.core.driver.entity.Idea;

import net.sf.json.JSONObject;

@Service
@Transactional
public class IdeaServiceImpl implements IdeaService{
	
	@Autowired
	IdeaMapper ideaMapper;

	@Override
	public int deleteByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public DataBean insert(Idea record) {
		record.setId(UuidUtils.getUUID());
		record.setIdeaTime(new Date());
		int i=ideaMapper.insert(record);
		if(i<=0){
			return new DataBean(404,new JSONObject(),"意见反馈失败");
		}
		
		return new DataBean(200,new JSONObject(),"意见反馈成功");
	}

	@Override
	public int insertSelective(Idea record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Idea selectByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int updateByPrimaryKeySelective(Idea record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKey(Idea record) {
		// TODO Auto-generated method stub
		return 0;
	}

}
